<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>对象继承</title>
</head>
<script>
    class Phone{
        constructor(brand,price){
            this.brand = brand
            this.price = price
        }
        call(){
            console.log('打电话')
        }
    }

    class SmartPhone extends Phone{
        constructor(brand,price,color,size){
            super(brand,price)
            this.color = color
            this.size = size
        }
        photo(){
            console.log('拍照')
        }
        call(){
            console.log('视频通话～～～')
        }
    }

    const xiaomi = new SmartPhone('小米',799,'黑色','4.7inch')
    console.log(xiaomi)
    xiaomi.call()
    xiaomi.photo()
</script>
</html>